home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
CON-03A.ZIP
/
UEDITOR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-09-01
|
5KB
|
207 lines
(* Groovy(tm) User Editor o.1α *)
unit ueditor;
interface
procedure init_ansi;
procedure init;
procedure next_u;
procedure previous_u;
procedure list_all;
procedure edit_user;
procedure exit;
procedure menu;
procedure run_usered;
implementation
uses crt,
editor;
Const
filename = 'data\users.dat';
Maxmembers = 10;
type
userrecord = record
handle : string[30];
location : string[30];
realname : string[30];
password : string[15];
voicephone : string[30];
dataphone : string[30];
lines : byte;
computer : string[30];
end;
var i :integer;
user : userrecord;
choice : char;
cows_come_home :boolean;
users: file of userrecord;
alldone : boolean;
procedure init_ansi;
begin
clrscr;
write_picture('editor');
end;
procedure init;
begin
assign(users,filename);
reset(users);
end;
procedure next_u;
begin
if not eof(users) then begin
read(users,user);
gotoxy(19,3);
write(user.handle+' ');
gotoxy(19,4);
write(user.password+' ');
gotoxy(19,5);
write(user.voicephone+' ');
gotoxy(19,6);
write(user.location+' ');
end;
end;
procedure previous_u;
begin
if not eof(users) then begin
read(users,user);
gotoxy(19,3);
write(user.handle+' ');
{ gotoxy(19,4);
write(user.password+' ');
gotoxy(19,5);
write(user.phone+' ');
gotoxy(19,6);
write(user.access,' ');}
end;
end;
procedure list_all;
var num : integer;
ch : char;
begin
textcolor(15);
clrscr;
writeln(' ■ Groovey Express User Listing ■ v0.01 Beta ■ (c)1995 Grooven Designs ■');
writeln;
reset(users);
num:=0;
repeat
inc(num);
if not eof(users) then begin
read(users,user);
write(num,') ');
writeln(user.handle);
end;
until eof(users);
writeln;
writeln(' Press any key to go back to the editor...');
ch:=readkey;
init_ansi;
init;
next_u;
end;
procedure edit_user;
begin
gotoxy(4,12);
writeln('(H) Handle, (P) Password, (#) Phone Number, (A) Access Level');
choice := readkey;
if (choice = 'H') or (choice ='h') then
begin
gotoxy(4,14);
writeln('Please Enter NEW Name User Name');
gotoxy(19,3);
readln(user.handle);
filemode :=2;
write(users,user);
gotoxy(4,14);
writeln(' ');
end;
{ if (choice = 'P') or (choice ='p') then
begin
gotoxy(4,14);
writeln('Please Enter NEW Password');
gotoxy(19,4);
readln(user.password);
filemode :=2;
write(users,user);
gotoxy(4,14);
writeln(' ');
end;
if (choice = '#') then
begin
gotoxy(4,14);
writeln('Please Enter NEW Phone Number');
gotoxy(19,5);
readln(user.phone);
filemode :=2;
write(users,user);
gotoxy(4,14);
writeln(' ');
end;
if (choice = 'a') or (choice = 'A') then
begin
gotoxy(4,14);
writeln('Please Enter NEW Access Level');
gotoxy(19,6);
readln(user.access);
filemode :=2;
write(users,user);
gotoxy(4,14);
writeln(' ');
end;}
end;
procedure exit;
begin
halt(0)
end;
procedure menu;
(* Menu selection for different usereditor option - NEEDS WORK BADLY *)
(* Make light bar selector *)
begin
next_u;
gotoxy(4,12);
write('(+) Next User, (-) Previous User, (E) Edit User, (L) List Users');
repeat
choice:=readkey;
if (choice = '+')
then next_u else
if (choice = '-')
then previous_u else
if (choice = 'a') or (choice = 'A')
then list_all else
if (choice = 'e') or (choice = 'E')
then edit_user else
if (choice = 'l') or (choice = 'L')
then list_all else
if (choice = 'Q') or (choice = 'q')
then
begin
clrscr;
writeln(' Thanks for choosing Groovey Express');
cows_come_home := true
end;
until cows_come_home
end;
(* Main body of the User Editor *)
procedure run_usered;
begin
init_ansi;
(*locate_user_file;*)
init;
menu;
end;
end.